﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;

namespace TaoBaoProject.Common
{
    public class ContextWeb
    {
        public static Users CurrentUser
        {
            get
            {
                return HttpContext.Current.Session["CurrentUser"] as Users;
            }
            set
            {
                HttpContext.Current.Session["CurrentUser"] = value;
            }
        }


        public static void LogoutCurrentUser()
        {

            HttpContext.Current.Session.Remove("CurrentUser");
            HttpContext.Current.Session.RemoveAll();

        }
    }
}